<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
	
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<?php $meta = $view->getConfig('site', 'meta'); ?>
	<?php foreach($meta as $name => $content): ?>
	<meta name="<?php echo $name; ?>" content="<?php echo $content ?>" />
	<?php endforeach; ?>
	
	<link rel="stylesheet" type="text/css" href="<?php echo $view->url->link('the-grid-v2.css') ?>" media="all" />
	<link rel="stylesheet" type="text/css" href="<?php echo $view->url->link('css/custom.css') ?>" media="all" />
	<link rel="stylesheet" type="text/css" href="<?php echo $view->url->link('js/jquery/tooltip/tipTip.css') ?>" media="all" />
	
	<?php if (isset($use_ui)):?>
	<link rel="stylesheet" type="text/css" href="<?php echo $view->url->link('js/jquery/ui/css/ui-lightness/jquery-ui-1.8.16.custom.css') ?>" media="all" />
	<?php endif;?>
	

	
	<title><?php echo $title ?></title>
	
	
	

<script type="text/javascript">
		window.___WowDataTooltip_Config = {
			'resources':{
				'locales':'<?php echo $view->url->link('js/wdt/locales/')?>',
				'jquery':'https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js',
				'qtip2':[
					'<?php echo $view->url->link('js/qtip2/jquery.qtip.min.js')?>',
					'<?php echo $view->url->link('js/qtip2/jquery.qtip.min.css')?>'
				],
				'extras':[
					'<?php echo $view->url->link('js/wdt/WowDataTooltip.css')?>'
				]
			}
		};
</script>
<script type="text/javascript" src="<?php echo $view->url->link('js/wdt/WowDataTooltip.js')?>"></script>


<script src="<?php echo $view->url->link('js/jquery/jquery.js') ?>" type="text/javascript"></script>
<script src="<?php echo $view->url->link('js/jquery/jquery.autoresize.js') ?>" type="text/javascript"></script>
<script src="<?php echo $view->url->link('js/jquery/tooltip/jquery.tipTip.minified.js') ?>" type="text/javascript"></script>
<script src="<?php echo $view->url->link('js/jquery/jquery.jeditable.mini.js') ?>" type="text/javascript"></script>

<?php if (isset($use_ui)):?>
	<script src="<?php echo $view->url->link('js/jquery/ui/js/jquery-ui-1.8.16.custom.min.js') ?>" type="text/javascript"></script>
<?php endif;?>


	<script type="text/javascript">
	/* <![CDATA[ */
	$(document).ready(function(){ 
		$('.tooltip').tipTip();

		
	    $.editable.addInputType('growfield', {
		    element : function(settings, original) {
		        var textarea = $('<textarea>');
		        if (settings.rows) {
		            textarea.attr('rows', settings.rows);
		        } else {
		            textarea.height(settings.height);
		        }
		        if (settings.cols) {
		            textarea.attr('cols', settings.cols);
		        } else {
		            textarea.width(settings.width);
		        }
		        // will execute when textarea is rendered
		        textarea.ready(function() {
		        	// implement your scroll pane code here
		        });
		        $(this).append(textarea);
		        return(textarea);
		    },
		    plugin : function(settings, original) {
		    	// applies the growfield effect to the in-place edit field
		        $('textarea', this).growfield(settings.growfield);
		    }
		});

		
	    $('.edit_area').editable('<?php echo $view->url->linkTo('Application','saveText')?>', { 
	    	type: "growfield",
	        cancel    : 'Cancel',
	        submit    : 'Save',
	        tooltip   : 'Click to edit...',
	        onblur: "ignore",
	        growfield : {}
	    });
	    

	});
	/* ]]> */
	</script>	

	<?php if (isset($use_forum)):?>
	<link rel="stylesheet" type="text/css" href="<?php echo $view->url->link('css/forum.css') ?>" media="all" />
	<?php endif;?>
</head>

<body class="wider">
<div id="layout">

	<div class="row">
		<div class="col c12 toplinks">
		
		<a href="<?php echo $view->url->linkTo('News','index')?>">News</a>
		<a href="<?php echo $view->url->linkTo('Application','about')?>">About</a>
		
		<?php if ($view->getConfig('donation','enable')): ?>
		<a href="<?php echo $view->url->linkTo('Donation','index')?>">Donate</a>
		<?php endif;?>
		<?php if ($view->getConfig('forum','enable')): ?>
		<a href="<?php echo $view->url->linkTo('Forum','index')?>">Forum</a>
		<?php endif;?>
		<?php if (isset($showAdminLink) && $showAdminLink): ?>
			<a href="<?php echo $view->url->linkTo('Admin', 'index')?>">Admin site</a>
		<?php endif;?>
		</div>
	</div>

	<div id="header" class="row">
		<div class="col c4">
			<h1><a class="red" href="<?php echo $view->url->linkTo('Application','index') ?>"><?php echo $view->getConfig('site', 'servername')?></a></h1>
			<p class="slogan"><?php echo $view->getConfig('site', 'slogan')?></p>
			
		</div>


				
		<div class="col c3">
			<h4>Account</h4>
			<ul class="menu">
				<?php if ($user):?>
				<li><h4><a href="<?php echo $view->url->linkTo('Auth','manage')?>">My Account</a></h4></li>
				<?php if (isset($showAdminLink) && $showAdminLink): ?>
				<li><h4><a href="<?php echo $view->url->linkTo('Auth','register')?>">Create account</a></h4></li>
				<?php endif; ?>
				<li><h4><a href="<?php echo $view->url->linkTo('Auth','logout')?>">Logout</a></h4></li>
				
				<?php else: ?>
				<li><h4><a href="<?php echo $view->url->linkTo('Auth','register')?>">Create account</a></h4></li>
				<li><h4><a href="<?php echo $view->url->linkTo('Auth','login')?>">Login</a></h4></li>
				<?php endif; ?>
			</ul>
		</div>

		
			
				<?php if (isset($realms)):?>
				<div class="col c3">
				<h4>Realms</h4>
				<ul class="menu">
				<?php foreach($realms as $realm): ?>
					<li><h4>
					<a href="<?php echo $view->url->linkTo('Application','realm', array('name' => $realm->getNameURL(), 'id' => $realm->id))?>">
					<?php echo $realm->name; ?>
					</a>: 
					<?php echo $realm->getService()->isUp() ? '<span style="color: green;">Server is up</span>' : '<span style="color: red;">Server is down</span>'?></h4></li>
				<?php endforeach;?>
				</ul>
				</div>
				<?php endif;?>
			
	
		<div class="col c2">
			<h4>Vote</h4>
			<?php foreach($view->getConfig('site','voteLinksTop') as $l):?>
			<?php echo $l; ?>
			<?php endforeach;?>
		</div>		
		
	</div>
	
	<div class="row">
		<div id="headerimage" class="col c12">
			<p><a href="<?php echo $view->url->linkTo('Application','index') ?>"><img src="<?php echo $view->url->link('images/header-1200.png')?>" alt="WoW background" /></a></p>
		</div>
	</div>
	
	<?php foreach($view->getMessages() as $message):?>
	<?php if ($message instanceof gnomephp\message\WarningMessage):?>
	<div class="col c12 message warning">
		<p><?php echo $message->getMessage()?></p>
	</div>
	<?php elseif($message instanceof gnomephp\message\InfoMessage): ?>
	<div class="col c12 message info">
		<p><?php echo $message->getMessage()?></p>
	</div>
	<?php elseif($message instanceof gnomephp\message\ErrorMessage): ?>
	<div class="col c12 message error">
		<p><?php echo $message->getMessage()?></p>
	</div>
	<?php elseif($message instanceof gnomephp\message\SuccessMessage): ?>
	<div class="col c12 message success">
		<p><?php echo $message->getMessage()?></p>
	</div>
	<?php endif; ?>
	<?php endforeach; ?>	

	<div class="row">
	<?php echo $view->getExtend('content'); ?>
	</div>

	<div id="footer" class="row">
		<div class="col c12">
			
			<p>Copyright &copy; <a href="http://pkj.no">Peec</a> - Powered by <a href="http://gnomephp.pkj.no">GnomePHP</a> and <a href="http://code.google.com/p/gnomewow/">GnomeWoW <?php echo $APP_VERSION?></a></p>
		</div>
	</div>
</div>




</body>
</html>
